Setting up a RTL8139 device on X86 wince platform :

 (1).Reserve 64k of physical memory space for a RTL8139 device:
        Add this line to config.bib::
           RTL8139A 80190000  00018000  RESERVED        ;//could be machine dependent
           												;//0x18000(96k)= 32k(tx buffer)+64k(rx buffer)

 (2).Modify Registry to configure RTL8139 driver and device:
        .Configure slot number
        .Configure reserved physical address
        1.Add this section to platform.reg::

	[HKEY_LOCAL_MACHINE\Comm\RTL8139]
	   "DisplayName"="Realtek RTL8139 based Fast Ethernet Driver"
	   "Group"="NDIS"
	   "ImagePath"="rtl8139.dll"

	[HKEY_LOCAL_MACHINE\Comm\RTL8139\Linkage]
	   "Route"=multi_sz:"RTL81391"

	[HKEY_LOCAL_MACHINE\Comm\RTL81391]
	   "DisplayName"="Realtek RTL8139 based Fast Ethernet Driver"
	   "Group"="NDIS"
	   "ImagePath"="rtl8139.dll"

	[HKEY_LOCAL_MACHINE\Comm\RTL81391\Parms]
   		"BusNumber"=dword:0
   		"BusType"=dword:5
	   	"PhysicalAddressBase"=dword:00190000 ;//set to reserved physical address in 'config.bib'
	   	"RxBufLen"=dword:3;			;(optional)size of rx buffer, 0:8k, 1:16k, 2:32k, 3:64k.
	   								;			note: the size of memory reserved in config.bib	depends on this setting.
	   								;			default:3
   		"DuplexMode"=dword:1		; (optional)speed/duplex mode, 1:auto(default), 
   									;				2:10half, 3:10full, 4:100half, 5:100full
   		"SharedInterrupt"=dword:1	;(optional)To shard interrupt or not. 0: not shared, 1: shared. Default: shared.
   		"ScanMethod"=dword:0		;(optional)Method to scan RTL8139 device,
   									;  0:PCI scan(default), 
   									;  1:NDIS call.
   									;  2:Fixed slot, use '"SlotNumber"=dword:x' to specify the slot number

;//if static IP is used
;//{
	[HKEY_LOCAL_MACHINE\Comm\RTL81391\Parms\TcpIp]
	   "DefaultGateway"="172.20.1.254"      ;//set to your tcpip setting
	   "LLInterface"=""
	   "UseZeroBroadcast"=dword:0
	   "IpAddress"="172.20.30.161"
	   "Subnetmask"="255.255.0.0"
;//}
;//else
;//{ DHCP is used
	[HKEY_LOCAL_MACHINE\Comm\RTL81391\Parms\TcpIp]
	   "EnableDHCP"=dword:1
	   "DefaultGateway"=""
	   "UseZeroBroadcast"=dword:0
	   "IpAddress"="0.0.0.0"
	   "Subnetmask"="0.0.0.0"
;//}


 (3). Bind TCPIP to RTL8139 device
        Add to platform.reg::
	[HKEY_LOCAL_MACHINE\Comm\Tcpip\Linkage]
	   "Bind"="ppp","RTL81391"

 (4).Add rtl8139.dll to WinCE OS Image:
 	Add this line to platform.bib::
           rtl8139.dll      $(_FLATRELEASEDIR)\rtl8139.dll            NK  SH

 (5).If the driver is successfully installed, a message will be printed to
     debug terminal on host machine. If not, the driver is not installed.
     Try to install RTL8139 on another slot, or try to use another physical
     memory base.
     If still not working, try debug build version of rtl8139.dll. This
     will dump debug mesasge to windbg or terminal on host machine. Please
     email this debug message to shangh@realtek.com.tw

 (6).Ethernet MAC address is written to registry at driver initialization time,
     the registry key is MACAddress.
